﻿@using System.Web.Services.Description
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>WeatheRx | @ViewBag.Title</title>
    <link href='http://fonts.googleapis.com/css?family=Lato|Roboto' rel='stylesheet' type='text/css'>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Styles.Render("~/Content/kendoCss")
    @Styles.Render("~/Content/datatablesCss")
    @*
        <link href="~/Content/kendo/2015.2.624/kendo.common.min.css" rel="stylesheet" />
        <link href="~/Content/kendo/2015.2.624/kendo.default.min.css" rel="stylesheet" />
        <script src="~/Scripts/kendo/2015.2.624/jquery.min.js"></script>
        <script src="~/Scripts/kendo/2015.2.624/kendo.core.min.js"></script>*@

    <script type="text/javascript">
        var appInsights = window.appInsights || function (config) {
            function s(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i) }) } } var t = { config: config }, r = document, f = window, e = "script", o = r.createElement(e), i, u; for (o.src = config.url || "//az416426.vo.msecnd.net/scripts/a/ai.0.js", r.getElementsByTagName(e)[0].parentNode.appendChild(o), t.cookie = r.cookie, t.queue = [], i = ["Event", "Exception", "Metric", "PageView", "Trace"]; i.length;) s("track" + i.pop()); return config.disableExceptionTracking || (i = "onerror", s("_" + i), u = f[i], f[i] = function (config, r, f, e, o) { var s = u && u(config, r, f, e, o); return s !== !0 && t["_" + i](config, r, f, e, o), s }), t
        }({
            instrumentationKey: "050cbd3a-b06f-46b4-bf2d-c09e62c14a8d"
        });

        window.appInsights = appInsights;
        appInsights.trackPageView();
    </script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
    <div id="searchNavbarResults"></div>
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            @Html.ActionLink("WeatheRx", "Index", "Home", new {area = ""}, new {@class = "navbar-brand"})
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav nav-tabs">
                <li role="presentation" class="dropdown ">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
                        WeatheRx <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li>
                            Admin Panel
                        </li>
                        <li>Jobs</li>
                        <li>
                            @Html.ActionLink("Applicants", "Index", "Applicants")
                        </li>
                        <li>Work Orders</li>
                        <li>Reports</li>
                    </ul>
                </li>
            </ul>

            <div class="col-sm-3 col-md-3 pull-right">

                <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search" name="SearchTerm" id="searchTerm">
                    <div class="input-group-btn">
                        <button class="btn btn-default" type="button" onclick=" searchNavbar(); "><i class="glyphicon glyphicon-search"></i></button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @Scripts.Render("~/bundles/kendo")
    @Scripts.Render("~/bundles/datatables")
    <div class="container body-content">
        @RenderBody()
        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year - WeatheRx.</p>
        </footer>
    </div>
    @Html.Partial("_LoginPartial")
   
    @Scripts.Render("~/bundles/site")
    @RenderSection("scripts", required: false)
    <script type="text/javascript">
        $(function () {
            var window = $("#searchNavbarResults");

        });

        var searchNavbar = function () {
            var window = $("#searchNavbarResults");

            var searchTerm = $('#searchTerm').val();
            kendo.ui.progress($("#searchNavbarResults"), true);
            window.kendoWindow({
                width: "615px",
                title: "Search Results",
                actions: ["Close", "Maximize"],
                modal: true
            });
            window.data("kendoWindow").refresh({
                url: "@Url.Action("Navbar","Search")",
                cache: true,
                data: { searchTerm: searchTerm },
                done: function () {
                    kendo.ui.progress($("#searchNavbarResults"), false);
                }
            });
            window.data("kendoWindow").center().open();

        }
    </script>
</body>
</html>